<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j"
                template="../../layout/site-template.xhtml">

    <ui:define name="menu">
        <ui:include src="../includes/menu/richmenuform.xhtml"/>
    </ui:define>

    <ui:define name="page-title">
        <h2>upload a file</h2>
    </ui:define>

    <ui:define name="left-content">
        <rich:panel id="fileinfo">
            <f:facet name="header">files:</f:facet>
            <rich:dataList var="_file" value="#{fileList.resultList}">
                <s:graphicImage value="#{_file.croppedByte.image}"
                                fileName="#{_file.id}_mini"
                                alt="[image]">
                    <s:transformImageSize height="32"
                                          maintainRatio="true"/>
                </s:graphicImage>
            </rich:dataList>
        </rich:panel>        
    </ui:define>

    <ui:define name="main-content-body">
        <h:form id="pageform" styleClass="ki-form">
            <rich:messages styleClass="message"
                           errorClass="errormsg"
                           infoClass="infomsg"
                           warnClass="warnmsg"
                           ajaxRendered="true"/>
            <fieldset class="columnar label-top">
                <legend>
                    Upload Files
                </legend>
                <a4j:outputPanel id="fileuploadpanel">
                    <rich:fileUpload fileUploadListener="#{fileUpload.listener}"
                                     maxFilesQuantity="100"
                                     listHeight="150">
                        <a4j:support event="onuploadcomplete" reRender="fileinfo"/>
                    </rich:fileUpload>
                </a4j:outputPanel>

            </fieldset>
        </h:form>
    </ui:define>
</ui:composition>
